package java0425;

//import java.util.Scanner;
//
//public class Main {
//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        while (sc.hasNext()) {
//            String input = sc.nextLine();
//            func(input);
//        }
//    }
//
//    public static void func(String str) {
//        String[] strings = str.split(" ");
//        for (int i = 0; i < strings.length; i++) {
//            String s = strings[i];
//            if (s.charAt(0) != '"' && s.charAt(s.length() - 1) != '"') {
//                System.out.println(s);
//            }else if (s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"') {
//                System.out.println(s.substring(1, s.length() - 1));
//            }else {
//                String s1 = "";
//                while (strings[i].charAt(strings[i].length() - 1) != '"') {
//                    s1 += strings[i];
//                    i++;
//                }
//                s1 += strings[i];
//                System.out.println(s.substring(1, s.length() - 1));
//            }
//        }
//    }
//}


// 参数解析
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String input = sc.nextLine();
            func(input);
        }
    }

    public static void func(String str) {
        int left = 0;
        int right = 0;
        boolean flag = false;
        List<String> list = new ArrayList<>();
        for (left = 0; right < str.length(); ) {
            if (str.charAt(left) != '"') {
                right = left + 1;
                while (right < str.length() && str.charAt(right) != ' ') {
                    right++;
                }
                list.add(str.substring(left, right));
                left = right + 1;
                right = left;
                continue;
            }
            if (str.charAt(left) == '"') {
                left++;
                right = left + 1;
                while (right < str.length() && str.charAt(right) != '"') {
                    right++;
                }
                list.add(str.substring(left, right));
                left = right + 1 + 1;
                right = left;
                continue;
            }
        }
        System.out.println(list.size());
        for (String x : list) {
            System.out.println(x);
        }
    }
}